const list = [
  {
    value: '1',
    label: '物理连接',
    labelKey: 'flowChart.physical',
    cssClass: {
      attrs: { line: { sourceMarker: { name: 'path' }, targetMarker: { name: 'path' }}}
    },
    path: 'M48,11H2V9h46V11z',
    color: '#000000'
  }, {
    value: '2',
    label: '材料连接',
    labelKey: 'flowChart.material',
    cssClass: { line: { strokeDasharray: 5, stroke: '#f5222d', sourceMarker: { name: 'path' }, targetMarker: { name: 'path' }}},
    path: 'M12,11H8V9h4V11z M6,11H2V9h4V11z M18,11h-4V9h4V11z M24,11h-4V9h4V11z M30,11h-4V9h4V11z M36,11h-4V9h4V11z M42,11h-4V9h4  V11z M48,11h-4V9h4V11z',
    color: '#f5222d'
  }, {
    value: '3',
    label: '能量传递(单向)',
    labelKey: 'flowChart.energySingle',
    cssClass: { line: { strokeDasharray: 5, stroke: '#3CB371' }},
    path: 'M12,11H8V9h4V11z M6,11H2V9h4V11z M18,11h-4V9h4V11z M24,11h-4V9h4V11z M30,11h-4V9h4V11z M36,11h-4V9h4V11z M42,11h-4V9h4  V11z M48,11h-4V9h4V11z M44.42,9.99V6.31l2.8,1.82L50,9.99l-2.78,1.85l-2.78,1.85L44.42,9.99z',
    color: '#3CB371'
  }, {
    value: '4',
    label: '能量传递(双向)',
    labelKey: 'flowChart.energyDouble',
    cssClass: { line: { strokeDasharray: 5, stroke: '#3CB371', sourceMarker: { name: 'classic' }, targetMarker: { name: 'classic' }}},
    path: 'M10,11H6V9h4V11z M16,11h-4V9h4V11z M22,11h-4V9h4V11z M28,11h-4V9h4V11z M34,11h-4V9h4V11z M40,11h-4V9h4V11z M46,11h-4V9  h4V11z M5.58,10.01v3.67l-2.8-1.82L0,10.01l2.78-1.85l2.78-1.85L5.58,10.01z M44.42,9.99V6.31l2.8,1.82L50,9.99l-2.78,1.85  l-2.78,1.85L44.42,9.99z',
    color: '#3CB371'
  }, {
    value: '5',
    label: '数据交换(单向)',
    labelKey: 'flowChart.dataSingle',
    cssClass: { line: { strokeDasharray: 5, stroke: '#FF8C00' }},
    path: 'M12,11H8V9h4V11z M6,11H2V9h4V11z M18,11h-4V9h4V11z M24,11h-4V9h4V11z M30,11h-4V9h4V11z M36,11h-4V9h4V11z M42,11h-4V9h4  V11z M48,11h-4V9h4V11z M44.42,9.99V6.31l2.8,1.82L50,9.99l-2.78,1.85l-2.78,1.85L44.42,9.99z',
    color: '#FF8C00'
  }, {
    value: '6',
    label: '数据交换(双向)',
    labelKey: 'flowChart.dataDouble',
    cssClass: { line: { strokeDasharray: 5, stroke: '#FF8C00', sourceMarker: { name: 'classic' }, targetMarker: { name: 'classic' }}},
    path: 'M10,11H6V9h4V11z M16,11h-4V9h4V11z M22,11h-4V9h4V11z M28,11h-4V9h4V11z M34,11h-4V9h4V11z M40,11h-4V9h4V11z M46,11h-4V9  h4V11z M5.58,10.01v3.67l-2.8-1.82L0,10.01l2.78-1.85l2.78-1.85L5.58,10.01z M44.42,9.99V6.31l2.8,1.82L50,9.99l-2.78,1.85  l-2.78,1.85L44.42,9.99z',
    color: '#FF8C00'
  }, {
    value: '7',
    label: '人机交互',
    labelKey: 'flowChart.humanComputer',
    cssClass: { line: { strokeDasharray: 5, stroke: '#0000FF', sourceMarker: { name: 'path' }, targetMarker: { name: 'path' }}},
    path: 'M12,11H8V9h4V11z M6,11H2V9h4V11z M18,11h-4V9h4V11z M24,11h-4V9h4V11z M30,11h-4V9h4V11z M36,11h-4V9h4V11z M42,11h-4V9h4  V11z M48,11h-4V9h4V11z',
    color: '#0000FF'
  }
]

export const lineTypeList = list

export function getLineByValue(value) {
  let result = list[0]
  for (let i = 0; i < list.length; i++) {
    if (value === list[i].value) {
      result = {
        value: list[i].value,
        label: list[i].label,
        cssClass: list[i].cssClass
      }
      break
    }
  }
  return result
}
